package com.lx.nba.util;

import java.text.SimpleDateFormat;
import java.util.Calendar;

public class ContentUtil {
	
	public static String getData( String content , int num ){
		
		int index = 0 ;
		
		for( int i = 0 ; i < content.length() ; i++){
			
			if( content.charAt(i) == '{'){
				
				index++ ;
				
			}else if( content.charAt(i) == '}'){
				
				content = content.substring(index, i+1) ;
				break ;
				
			}
			if( index == num ){
				
				index = i ;
				
			}
			
		}
		
		
		return content ;
		
	} 

	public static String getDate( int day ){
		
		Calendar calendar = Calendar.getInstance() ;
		
		calendar.add(Calendar.DAY_OF_MONTH, day);
		
		SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd") ;
		
		return format.format(calendar.getTime()) ;
		
	}
	
}
